<template>
  <div>
    <div class="banner" @click="bannerClick">
        <img class="banner-img" :src="bannerImg" >
        <div class="banner-info">
            <div class="banner-title">{{sightName}}</div>
            <div class="banner-number"><span class="iconfont banner-icon">&#xe692;</span>{{gallaryImgs.length}}</div>
        </div>
    </div>
     <fade-animation>
        <common-gallary :imgs="gallaryImgs" v-show="showGallary" @close="handleGallaryClose"></common-gallary>
     </fade-animation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: "DetailBanner",
  components:{
      CommonGallary,
      FadeAnimation
  },
  props:{
      sightName: String,
      bannerImg: String,
      gallaryImgs: Array
  },
  data () {
      return {
           showGallary:false,
      }
      
  },
  methods: {
      bannerClick () {
          this.showGallary = true
      },
      handleGallaryClose () {
          this.showGallary = false
      }
  }
};
</script>

<style lang="scss" scoped>
.banner {
  overflow: hidden;
  padding-bottom: 55%;
  height: 0;
  position: relative;
  .banner-img {
    width: 100%;
    vertical-align: top;
  }
  .banner-info {
    display: flex;
    position: absolute;
    align-items: center;
    left: 0;
    right: 0;
    bottom: .15rem;
    line-height: 0.8rem;
    color: #fff;
    background: linear-gradient(rgba(#000,.0), rgba(#000,.8));
    .banner-title {
      font-size: 0.36rem;
      padding: 0 0.2rem;
      flex: 1;
    }
    .banner-number {
      padding: 0  .2rem;
      margin-right: .2rem;
      height: 0.32rem;
      line-height: 0.32rem;
      font-size: .24rem;
      border-radius: 0.2rem;
      background: rgba(#000, 0.7);
      .banner-icon{
          margin-right: .1rem;
          font-size: .24rem;
      }
    }
  }
}
</style>
